#ifndef UKEYACTIVATIONWIDGET_H
#define UKEYACTIVATIONWIDGET_H

#include <QWidget>
#include <QMessageBox>
#include <QTimer>
#include <QDBusObjectPath>
#include "receive_dbus.h"
#include "activation_thread.h"
#include "interface.h"
extern "C" {
#include <kylin-activation.h>
}

namespace Ui {
class UkeyActivationWidget;
}

class UkeyActivationWidget : public QWidget
{
    Q_OBJECT

public:
    explicit UkeyActivationWidget(QWidget *parent = nullptr);
    ~UkeyActivationWidget();

    activation_thread *m_thread=nullptr;
    ukey_find_thread *ukey_found_thread=nullptr;
    QTimer *m_timer=nullptr;

    void resetControlsState(int type);
    void setRemindLabelText();
    void restartCheckUkey();

private slots:
    void on_returnbtn_clicked();
    void autoUkeyActivation(int activation);
    void on_retrybtn_clicked();

private:
    Ui::UkeyActivationWidget *ui;
    int flag = 0;
    int activationState=-1;

protected:
    void paintEvent(QPaintEvent *event);

signals:
    void returnSignal();
    void activateSucceed();
    void activationMessageSignal(int activation);//激活信息发送信号
};

#endif // UKEYACTIVATIONWIDGET_H
